use anchor_lang::prelude::*;

declare_id!("7x2zUUnmLQqtP7KxiqzVRewvuP8MnnRkpBDB21fhP1pY");

#[program]
pub mod message_auth {
    use super::*;

    pub fn initialize(ctx: Context<Initialize>) -> Result<()> {
        msg!("Greetings from: {:?}", ctx.program_id);
        Ok(())
    }
    pub fn outbound_call(ctx: Context<OutboundCall>, network_id:u128, contract_address: Vec<u8>, functionCallData: Vec<u8>, source_contract_address: [u8;32],authority_bump:u8,call_program_id:Pubkey) -> Result<()> {

        msg!("outbound_call, networkId:{:?}, contract_address: {:?}, functionCallData: {:?}, source_contract_address: {:?}", network_id.clone(), contract_address.clone(), functionCallData.clone(), source_contract_address.clone());
        Ok(())
    }
}

#[derive(Accounts)]
pub struct Initialize {}


#[derive(Accounts)]
#[instruction(network_id:u128, contract_address: Vec<u8>, functionCallData: Vec<u8>, source_contract_address: [u8;32],authority_bump:u8,call_program_id:Pubkey)]
pub struct OutboundCall<'info> {
    #[account(seeds=[b"outbound_call"],
    bump = authority_bump,
    seeds::program  = call_program_id,
    )]
    pub authority_pda:Signer<'info>
}